<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=600,target-densitydpi=device-dpi,maximum-scale=1.0, user-scalable=no">
		<title>congratulation</title>
		<link rel="stylesheet" type="text/css" href="../css/congratulation.css"/>
		<link rel="stylesheet" type="text/css" href="../css/reset.css"/>
	</head>
	<body>
		<div class="conter">

			<div class="top">
				<div class="beijing"><img src="../img/game/九宫格_01.jpg" /></div>
				<div class="shuoming"><img src="../img/game/11.png" /></div>
				<div class="music">
					<img src="../img/game/12.png" />
				</div>
				<div class="guize"><img src="../img/game/asd.png" /></div>
			</div>
			<div class="center">
				<img src="../img/congratulation/123_02.jpg"/>
				<div class="center1"></div>
			<div class="center2"><img src="../img/congratulation/1.png"/></div>
			</div>
			
	   </div>
		
		<script src="../js/jquery-2.1.0.js"></script>
		<script>
			//自动播放
			var audio = document.createElement('audio');
			audio.src = '../music/Christmas.mp3';
			audio.autoplay = true;
			document.body.appendChild(audio);
			document.addEventListener('touchstart', function() {
				//增加一个touchstart交互事件，触屏后播放音乐
				audio.play();
				//播放音频后移除touchstart事件的当前匿名函数
				document.removeEventListener('touchstart', arguments.callee, false);
			}, false);

			var conter = document.getElementsByClassName("conter")[0];
			var music = conter.getElementsByClassName("music")[0];

			music.addEventListener("click", function() {

				if(document.body.contains(audio) == true) {
					document.body.removeChild(audio);
				} else {
					document.body.appendChild(audio);
					audio.play();
				}
			})
			
			var shuoming = document.getElementsByClassName("shuoming")[0];
			var guize = document.getElementsByClassName("guize")[0];
			var center = document.getElementsByClassName("center")[0];
			var center1 = document.getElementsByClassName("center1")[0];
			var center2 = document.getElementsByClassName("center2")[0];
			var center3 = document.getElementsByClassName("center3")[0];
			

			center2.addEventListener("click", function() {
				guize.style.display = "block";
				center1.style.display = "none";
				center2.style.display = "none";
			})
			guize.addEventListener("click", function() {
				guize.style.display = "none";
				center1.style.display = "block";
				center2.style.display = "block";
			})
			
			function Bushu(param){
				var sValue = location.search.match(new RegExp("[\?\&]" + param + "=([^\&]*)(\&?)", "i"));
				return sValue ? decodeURI(sValue[1]) : decodeURI(sValue);
			}
			console.log(Bushu("bushu"));
			
			$(".center1").css({
				background: "url(../img/game/" + Bushu("bushu") +".png) no-repeat",
			})
			
			
		</script>
	</body>
</html>
